Creating OCR checkpoints

Optical character recognition (OCR) reads graphical text in applications and converts it to a text string. Create OCR checkpoints to verify text in images, controls QA Wizard Pro cannot recognize, or in a specified region in a window or control. For example, you can use these checkpoints to verify text in web pages or images, such as charts and graphs.

OCR technology is not exact. The actual text returned from the application and the expected text may not match exactly due to factors such as font, font size, and contrasting background colors. Because of this, you can specify the minimum level of accuracy for the checkpoint to pass. You can also change the default options used to read images using OCR during playback or use additional statements to adjust OCR settings. See Troubleshooting OCR issues for tips that can help provide best results.

1. Select the script line above where to add the statement.

2. Choose Script > Add Statement.

The Add Statement dialog box opens.

3. Select OCR Checkpoint in the OCR category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list.

5. Select the Window to check for text in.

A screenshot of the selected window is displayed.

6. If you are checking for text in a control, select the Control.

The selected control is outlined with a red box in the screenshot.

7. Enter or select the Expected text to compare to the actual text. You can use a text string (default), expression, datasheet column value, variable, or function that returns the value.

8. Enter the minimum percentage of Accuracy required between the actual and expected text to pass the checkpoint.

The text in the application and the expected text may not match exactly. For example, if the minimum accuracy percentage is 80% and the accuracy during playback is 85%, the checkpoint passes without requiring an exact match. The default accuracy is 92%.

9. Enter the OCR Region information to specify where to find the text.

These fields are automatically populated based on the location and size of the selected window or control. You can also click the screenshot and drag the red rectangle to select the region to use, which updates the values.

10. Click Test to make sure the checkpoint passes before adding it to the script.

A dialog box opens that indicates if the expected text matches the actual text and the accuracy percentage calculated when comparing the values. You can use this information to change the expected text or minimum accuracy to make sure the checkpoint passes during playback. For example, if the test fails with 90% accuracy, you can decrease to the minimum accuracy to 90%.

11. Click OK to close the test dialog box.

12. Expand the Advanced options to indicate what happens if the checkpoint fails.

13. Enter an optional Comment, such as the purpose of the statement.

14. Click OK to add the statement to the script.

You can edit checkpoints if graphical text in the application changes. You can also delete checkpoints that are no longer needed. See Editing checkpoints and Deleting checkpoints.